import sys
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow
from imaging import Ui_Dialog


class mwindow(QWidget, Ui_Dialog):
    def __init__(self):
        super(mwindow, self).__init__()
        self.setupUi(self)
        self.connecter()

    def ps_bt(self):
        text = self.lineEdit.text()
        self.textBrowser.append('我:' + text)
        self.textBrowser.moveCursor(self.textBrowser.textCursor().End)  # 文本框显示到底部
        self.lineEdit.setText('')


    def connecter(self):
        self.pushButton.clicked.connect(self.ps_bt)



if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = mwindow()
    w.show()
    sys.exit(app.exec_())